package animationEngine;

/**
 * The Class AnimationState, this class holds all the necessary information for a single frame
 * of an animation.  These states are loaded into an array for each algorithm after the input 
 * frame is closed.
 * 
 * This array of states is then used when stepping through the animation or playing it.
 * 
 * @author Andrei Palade
 * @author David McBrierty
 * @author Garry Sharp
 * @author Hristo Georgiev
 * @author John Dennis
 * @author Marco Sarconi
 * @version 1.0.1
 */
public class AnimationState {
	
	/** The starting index in text. */
	public int startingIndexInText;
	
	/** The position of pattern. */
	public int positionOfPattern;
	
	/** The line of pseudo code. */
	public int lineOfPseudoCode;
	
	/** The highlighted text character. */
	public int highlightedTextCharacter;
	
	/** The highlighted pattern character. */
	public int highlightedPatternCharacter;
	
	/** Whether or not the characters being scanned match. */
	public boolean matches;
	
	/**
	 * Instantiates a new animation state.
	 *
	 * @param textIndex the text index
	 * @param patternPosition the pattern position
	 * @param pseudoCodeLine the pseudo code line
	 * @param textCharacterHighlight the text character highlight
	 * @param patternCharacterHighlight the pattern character highlight
	 * @param matches the matches
	 */
	public AnimationState(int textIndex, int patternPosition, int pseudoCodeLine,
			int textCharacterHighlight, int patternCharacterHighlight, boolean matches){
		
		this.startingIndexInText = textIndex;        

		this.positionOfPattern = patternPosition;
		this.lineOfPseudoCode = pseudoCodeLine;
		this.highlightedTextCharacter = textCharacterHighlight;
		this.highlightedPatternCharacter = patternCharacterHighlight;
		this.matches = matches;
		
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		return "Index="+ this.startingIndexInText + ",PatternPosition=" + this.positionOfPattern +
		",PseudoCodeLine="+this.lineOfPseudoCode + ",PatternHighlight="+this.highlightedPatternCharacter
		+",TextHighlight="+this.highlightedTextCharacter+",Matches="+this.matches;
	}
	
	
}
